// 模板方法模式
const Template = function (params) {
    this.params = params
}

Template.prototype = {
    init() {
        this.start()
        this.end()
    },
    start() {
        console.log('start')
    },
    end() {
        console.log('end')
    }
}
const Child = function (params) {
    Template.call(this, params)
}

// 继承 Template 的原型
Child.prototype = Object.create(Template.prototype)
Child.prototype.constructor = Child

// 使用
const child = new Child()
child.init()